local hx__fuji = fk.CreateSkill {
  name = "hx__fuji",
  tags = { Skill.Compulsory },
}

hx__fuji:addEffect(fk.CardUsing, {
  anim_type = "offensive",
  can_trigger = function(self, event, target, player, data)
    return target == player and player:hasSkill(hx__fuji.name) and (data.card.trueName == "slash" or data.card:isCommonTrick())
  end,
  on_use = function(self, event, target, player, data)
    local targets = table.filter(player.room:getOtherPlayers(player), function(p) 
      return p:distanceTo(player) < 3 or player:inMyAttackRange(p)
    end)
    if #targets > 0 then
      data.disresponsiveList = data.disresponsiveList or {}
      for _, p in ipairs(targets) do
        table.insertIfNeed(data.disresponsiveList, p)
      end
    end
  end,
})

hx__fuji:addEffect(fk.Damaged, {
  anim_type = "offensive",
  can_trigger = function(self, event, target, player, data)
    return target ~= player and data.from == player and player:hasSkill(hx__fuji.name)
  end,
  on_use = function(self, event, target, player, data)
    local room = player.room
    room:addPlayerMark(target, "@@hx__fuji-turn")
    room:addPlayerMark(target, MarkEnum.UncompulsoryInvalidity.. "-turn")
  end,
})


return hx__fuji